//
//  LoginViewController.h
//  IceBreaker
//
//  Created by Chiao Wolfire on 12-10-3.
//  Copyright (c) 2012年 NDS. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "AsyncSocket.h"

@interface LoginViewController : UIViewController<UITextFieldDelegate>

@property(nonatomic, retain) IBOutlet UILabel *mailLabel, *pwdLabel;
@property(nonatomic, retain) IBOutlet UITextField *mailTxt, *pwdTxt;
@property(nonatomic, retain) IBOutlet UIButton *loginBtn, *registerBtn;
@property(nonatomic, retain) AsyncSocket *mySocket;
@property(nonatomic, retain) NSString *serverIP;
@property(nonatomic, assign) UInt16 connectPort;
@property(nonatomic, assign) NSTimeInterval connectTime;

// button touched
-(IBAction) buttonTouched:(id)sender;
// touch the view to close the keyboard
-(IBAction) closeViewEdit:(id)sender;
// Create socket connection
-(int) createConnection: (NSString *)hostIP
                   port: (UInt16)hostPort
                timeout: (NSTimeInterval) timeout;
// reconnect
-(IBAction)reConnect:(NSString *) hostIP
                port:(UInt16)hostPort
             timeout:(NSTimeInterval)timeout;
// send data
-(IBAction) sendData:(NSData *)dataToSend
             timeout:(NSTimeInterval)timeout;

@end
